
#ifndef RS_BLOCK_H
#define RS_BLOCK_H

C_BEGIN_DECLS

typedef struct
{
	int _block_count1;
	int _block_count2;
	int _data_length1;
	int _data_length2;
	int _ecc_length;
	int _entire_data_length;
	int _entire_ecc_length;
	unsigned char* _data;
	unsigned char* _ecc;
} RSBlock;

// Take ownership of data.
RSBlock* rs_block_new(int version, int ec_level, unsigned char* data);
void rs_block_destroy(RSBlock* rs_block);
int rs_block_entire_count(RSBlock* rs_block);
unsigned char rs_block_get_code(RSBlock* rs_block, int index);

C_END_DECLS

#endif	// RS_BLOCK_H

